package method.method1202;

import java.util.Scanner;

//往数组中插入一个数，再按照从小到大排列{12,14,23,45,66,68,70,77,90,91};
public class arr04 {
    public static void main(String[] args) {
        int[] arr={12,14,23,45,66,68,70,77,90,91};
        Scanner sc=new Scanner(System.in);
        System.out.println("请输入一个数：");
        int num=sc.nextInt();
        int index=0;
        int[] brr=new int[11];
        for (int i = 0; i < arr.length; i++) {
            if (num>=arr[i]){
                brr[i]=arr[i];
                index=i+1;
            }else {
                brr[i+1]=arr[i];
            }
        }
        brr[index]=num;
        for (int i = 0; i < brr.length; i++) {
            System.out.println(brr[i]);
        }
    }
}
